#ifndef WF_DRAWLINETANGENT1_H
#define WF_DRAWLINETANGENT1_H

#include "pf_previewactioninterface.h"
#include "gui_export.h"

/**
 * This action class can handle user events to draw tangents from points
 * to circles.
 *
 */
class GUI_EXPORT WF_DrawLineTangent1 : public PF_PreviewActionInterface {
	Q_OBJECT
private:
    enum Status {
        SetPoint,     /**< Choose the startpoint. */
        SetCircle      /**< Choose the circle / arc. */
    };

public:
    WF_DrawLineTangent1(PF_Container& container,
                              PF_GraphicView& graphicView);
    ~WF_DrawLineTangent1() {}

	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);

    virtual void trigger();
	
    virtual void mouseMoveEvent(PF_MouseEvent* e);
    virtual void mouseReleaseEvent(PF_MouseEvent* e);
	
	virtual void coordinateEvent(PF_CoordinateEvent* e);
	
    virtual void updateMouseButtonHints();
    virtual void updateMouseCursor();
    virtual void updateToolBar();

private:
    /** Closest tangent. */
    PF_Line* tangent;
    /** Chosen startpoint */
    PF_Vector point;
    /** Chosen entity */
    PF_Entity* circle;
    /** Data of new tangent */
    PF_LineAttribute data;
};

#endif
